package service;

import entity.Price;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import dao.ShoppingMapper;
import entity.Shopping;
import service.ShoppingService;

import java.util.List;

@Service
public class ShoppingServiceImpl implements ShoppingService{

    @Resource
    private ShoppingMapper shoppingMapper;

    @Override
    public int deleteByPrimaryKey(Integer sid) {
        return shoppingMapper.deleteByPrimaryKey(sid);
    }

    @Override
    public int insert(Shopping record) {
        return shoppingMapper.insert(record);
    }

    @Override
    public int insertSelective(Shopping record) {
        return shoppingMapper.insertSelective(record);
    }

    @Override
    public Shopping selectByPrimaryKey(Integer sid) {
        return shoppingMapper.selectByPrimaryKey(sid);
    }

    @Override
    public int updateByPrimaryKeySelective(Shopping record) {
        return shoppingMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Shopping record) {
        return shoppingMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Shopping> getid(int sclassification) {
        return shoppingMapper.getid(sclassification);
    }

    @Override
    public Shopping idcx(int sid) {
        return shoppingMapper.idcx(sid);
    }

    @Override
    public List<Shopping> gettuijian() {
        return shoppingMapper.gettuijian();
    }

    @Override
    public int addShopping(Price price) {
        return shoppingMapper.addShopping(price);
    }

    @Override
    public List<Price> getselect(int puserid) {
        return shoppingMapper.getselect(puserid);
    }

    @Override
    public int updel(int puserid, int pshoppingId,int pnum) {
        return shoppingMapper.updel(puserid,pshoppingId,pnum);
    }

    @Override
    public List<Shopping> getlist(int uid) {
        return shoppingMapper.getlist(uid);
    }

    @Override
    public int getdelete(int pid) {
        return shoppingMapper.getdelete(pid);
    }

  public  List<Shopping> list1(String chaname,int start, int pageSize){
        return shoppingMapper.list1(chaname,start,pageSize);
    }

    @Override
    public int listzong(String chaname) {
        return shoppingMapper.listzong(chaname);
    }
    public Shopping xiulist(@Param("id") int id){

        return shoppingMapper.xiulist(id);
    }

    public int insert1(Shopping r){return shoppingMapper.insert1(r);}

    public  int del1(int sid){return shoppingMapper.del1(sid);}

}
